package com.jwdf.uda.http.action;

import android.content.Context;

import com.jwdf.uda.bean.PbBean;
import com.jwdf.uda.http.AHttpService;
import com.jwdf.uda.http.ApiService;

import retrofit2.Call;

/**
 * 类说明：用户退出
 * 作者：huangqiuxin on 2016/5/12 19:14
 * 邮箱：648859026@qq.com
 */
public class LogoutAction extends AHttpService<PbBean.PbResUserLogout> {
    /**
     * 用户退出请求
     * @param context
     * @return
     */
    public static LogoutAction newInstance(Context context) {
        return new LogoutAction(context);
    }

    private LogoutAction(Context context) {
        super(context);
    }

    @Override
    protected Call newRetrofitCall(ApiService apiService, PbBean.PbBaseClientInfo.Builder baseBuilder) {
        PbBean.PbReqUserLogout.Builder builder = PbBean.PbReqUserLogout.newBuilder();
        builder.setBaseClientInfo(baseBuilder);

        return apiService.logout(builder.build());
    }
}
